package com.clstu.transformation;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

public class OutputStreamWriter_ {
    public static void main(String[] args) throws IOException {
        String charSet = "utf-8";
        OutputStreamWriter gbk = new OutputStreamWriter(new FileOutputStream("D:\\b.txt"),charSet );//可以将文件按照指定的方式保存
        gbk.write("hello , I am 宇宙超级无敌霸王龙阿龙");
        gbk.close();
        System.out.println("文件保存成功，编码方式====="+charSet);
    }
}
